﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
<!--这meta的作用就是删除默认的苹果工具栏和菜单栏。-->
<meta name="apple-mobile-web-app-capable" content="yes"/>
<!--在web app应用下状态条（屏幕顶部条）的颜色-->
<meta name="apple-mobile-web-app-status-bar-style" content="black"/>
<!--该标签用于指定是否将网页内容中的手机号码显示为拨号的超链接。-->
<meta name="format-detection" content="telephone=no"/>
<!--网页在任何时候都不能被Cache存储-->
<meta http-equiv="Expires" content="-1"/>
<!--清除缓存-->
<meta http-equiv="Cache-Control" content="no-cache"/>
<meta http-equiv="Pragma" content="no-cache"/>
<title></title>
<!--幻灯片用JS-->
<script language="javascript" type="text/javascript" src="${ctx}/static/web/js/jquery.js"></script>
<script language="javascript" type="text/javascript" src="${ctx}/static/web/js/dropload.min.js"></script>
<!--幻灯片用JS End-->
<link href="${ctx}/static/web/css/main.css" rel="stylesheet" type="text/css" />
<link href="${ctx}/static/web/css/user.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/jscript">
$(document).ready(function(){
	//点击分类图标，展示更多菜单
	$("#a-dr-menu").click(function(){
		$(".f-dr-menu").slideToggle();
	});
var u = navigator.userAgent;
var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //android终端
var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
if (isAndroid){
$('#op2').css("display" , "block");
}else{
$('#op1').css("display" , "block");
}
});	
$(function(){
    var itemIndex = 0;
    var tab2LoadEnd = false;
    $('.iitem').on('click',function(){
        var $this = $(this);
        itemIndex = $this.index();
        $this.addClass('on').siblings('.iitem').removeClass('on');
        // 如果选中菜单一
        if(itemIndex == '0'){
          $('.function-block').css('display' , 'block');
          $('.list-containner').css('display' , 'none');
        }else if(itemIndex == '2'){
            $('.function-block').css('display' , 'none');
            $('.list-containner').css('display' , 'block');
            if(!tab2LoadEnd){
                // 解锁
                dropload.unlock();
                dropload.noData(false);
            }else{
                // 锁定
                dropload.lock('down');
                dropload.noData();
            }
        }
        // 重置
        dropload.resetload();
    });
    var sum = 0;
    var counter = 0;
    // 每页展示4个
    var num = 4;
    var pageStart = 0,pageEnd = 4;

    // dropload
    var dropload = $('.viewport').dropload({
        scrollArea : window,
        domDown : {
            domClass   : 'dropload-down',
            domRefresh : '<div class="dropload-refresh">↓下拉加载更多</div>',
            domLoad    : '<div class="dropload-load"><span class="loading"></span>加载中...</div>',
            domNoData  : '<div class="dropload-noData">暂无数据</div>'
        }, 
        loadDownFn : function(me){
            // 加载菜单一的数据
            if(itemIndex == '2'){
                $.ajax({
                    type: 'GET',
                    url: '${ctx}/wechatapi/ajaxmycollection?pageCurrent='+(counter+1),
                    dataType: 'json',
                    success: function(data){
                        var result = '';
                        counter++;
                            for(var i = pageStart; i < pageEnd; i++){
                            	if (i <= data.pageData.length-1){
                            		sum++;
                            		var iurl = "";
                            		if (data.pageData[i].img == null){
                            			iurl="${ctx}/static/web/img/wechat.png";
                            		}else{
                            			iurl=data.pageData[i].img+'46';
                            		}
                                    result +=   '<div class="que-list">'
                                        +'<div class="que-t"><span>'+data.pageData[i].title+'</span><a class="btn-r right" href="${ctx}/wechatapi/detail?id='+data.pageData[i].id+'">&nbsp;</a></div>'
                                        +'<div class="clear"></div>'
                                        +'<div class="que-con01 clearfix">'
                                        +'<div class="photo-small">'
                                        +'<img src="'+iurl+'" /></div>'
                                        +'<div class="bref">'+(data.pageData[i].content==null?"":data.pageData[i].content)+'</div>'
                                        +'<div class="icon-area">'
                                        +'<ul><li>'+data.pageData[i].collections+'</li><li>'+data.pageData[i].replys+'</li><li>'+data.pageData[i].praise+'</li></ul></div></div></div>';                        		
                            	}
                                if(sum == data.totalRow){
                                	tab2LoadEnd = true;
                                	counter = counter-1;
                                    // 锁定
                                    me.lock();
                                    // 无数据
                                    me.noData();
                                    break;
                                }
                            }
                            // 为了测试，延迟1秒加载
                            setTimeout(function(){
                                $('.list-containner').append(result);
                                // 每次数据加载完，必须重置
                                me.resetload();
                            },100); 
                    },
                    error: function(xhr, type){
                        alert('Ajax error!');
                        // 即使加载出错，也得重置
                        me.resetload();
                    }
                });
            // 加载菜单二的数据
            }
        }
    });    
});
</script>
</head>

<body style="background-color:#f5f5f5; padding-bottom:50px;">
<div class="viewport">
<div class="top-op clearfix">
<table cellspacing="0" width="100%">
<tr>
<td id="op1" style="display:none">
<div class="op">
<a href="javascript:history.go(-1);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
</div>
</td>
<td id="op2" style="display:none">
<div class="op-l">
<a href="javascript:history.go(-1);">返回</a>
</div>
</td>

<td>用户中心</td>
<td>
<div class="op-r"  style="background:none">
<a href="javascript:"></a>
</div>
</td>
</tr>
</table>
</div>
<!--用户信息-->
<div class="user-info">
<div class="icon-r"><img src="${ctx}/static/web/css/img/user-icon01.png"  /></div>
<div class="user-photo">
<%
  if (session.member.headimgurl == null){
%>
<img src="${ctx}/static/web/img/wechat.png" />
<%
  }else{
%>
<img src="${session.member.headimgurl!}0" />
<%
  }
%>
</div>
<div class="user-name">${session.member.nickname!}</div>
<ul class="tab-ul">
<li class="iitem on">个人主页</li>
<li class="jg"></li>
<li class="iitem">我的收藏</li>
</ul>
<div class="clear"></div>
</div>
<!--用户信息 End-->

<!--功能块区域-->
<div class="function-block" style="display:block">
<div class="myask block">我的问答<a class="btn-r right">&nbsp;</a></div>

<!--合同管理-->

<div class="mycontra block">
合同管理<a class="btn-r right">&nbsp;</a>
</div>

<div class="contra-list block">
<ul>
<li>我的合同<a class="btn-r right">&nbsp;</a></li>
<li>合同审查<a class="btn-r right">&nbsp;</a></li>
<li>合同模板<a class="btn-r right">&nbsp;</a></li>
</ul>
</div>
<!--合同管理End-->
</div>
<div class="list-containner" style="display:none">
</div>
<!--功能块区域End-->

<div class="clear"></div>
<!--底部-->
<div class="footbar">
<table class="foot-tb" cellspacing="0">
<tr>
<td class="opr"><a href="javascript:" id="a-dr-menu"></a><ul class="f-dr-menu" style="display:none;"><li><a href="${ctx}/wechatapi/portal">首页</a></li><li><a href="${ctx}/wechatapi/user">我的</a></li></ul></td>
<td class="add"><a href="${ctx}/wechatapi/ask"></a></td>
<td class="search"><a href="${ctx}/wechatapi/search"></a></td>
</tr>
</table>
</div>
<!--底部 End-->
</div>
</body>
</html>
